package com.linuxgt.mobile.controller;

import com.linuxgt.mobile.Xml;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created with IntelliJ IDEA.
 * User: LIUTENG
 * Date: 13-5-2
 * Time: 下午2:28
 * To change this template use File | Settings | File Templates.
 */
@Controller("com.linuxgt.mobile.controller.SpringMvcTest")
@RequestMapping("/test/*")
public class SpringMvcTest {

    @RequestMapping(value = "/home",method = RequestMethod.GET)
    public String home(){
        return "home";
    }

    @RequestMapping(value = "wxpost",method = RequestMethod.POST)
    public ModelAndView wxInterface(@RequestBody String body,HttpServletRequest request,HttpServletResponse response){
        System.out.println(body);
        System.out.println(request.getContextPath());
        Xml.xmlResult(body);
        return new ModelAndView("");
    }
}
